<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>发布</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__CSS__/switch.css">
    <style type="text/css">
        body{background: #f5f3f3;}
        .top_span_l{display: inline-block;width: 30%;}
        .top_span_m{display: inline-block;width: 30%;text-align: center;}
        .top_span_r{display: inline-block;width: 30%;text-align: right;}
        .txt{font-size: 16px; box-sizing: border-box; resize: none; outline: none; padding: 10px 6px; height: 180px; display: flex; width: 100%; border: none;}
    </style>
    <script src='__JS__/jquery.min.js'></script>
</head>
<body>
<!-- 顶部固定导航 -->
<nav class="navbar navbar-default" style="padding-top: 5px;background-color: rgb(66, 185, 131);font-size: 25px;color: white;margin-bottom: 0px;">
    <span class="glyphicon glyphicon-remove top_span_l"></span>
    <span class="top_span_m">举报</span>
    <span class="glyphicon glyphicon-ok top_span_r"></span>
</nav>
<!-- 中部帖子具体内容 -->
<div>
    <form>
        <textarea class="form-control txt" rows="5" style="background: white;"></textarea>
    </form>
</div>
<!-- 底部发送 -->
<div class="container" style="padding-top: 10px;">
	<span style="display: inline-block;width: 40%;float: right;text-align: right;">
		<button class="btn btn-md" style="color: green;border-radius: 10px;" id="sub_jubao">SEND</button>
	</span>
    <div style="clear: both;"></div>
</div>
<!-- JS脚本版块 -->
<script type="text/javascript">
    $('.top_span_l').click(function() {
        location.href="{:U('Home/Index/index')}";
    });
    //举报
    $("#sub_jubao").click(function(){
        if($('.txt').val().length==0){
            layer.open({
                content: '举报信息不能为空.....'
                ,btn: '我知道了'
            });
            return false;
        }
        var msg_id  =   "<?php echo $tie_id;?>";
        if(parseInt(msg_id)<1){
            layer.open({
                content: '帖子参数丢失.....'
                ,btn: '我知道了'
            });
            return false;
        }
        $.ajax({
            type:'post',
            url:"{:U('Home/Index/jubao')}",
            data:{msg_id:msg_id,content:$('.txt').val()},
            dataType:'json',
            success:function(res){
                if(res.state!=1){   //举报失败
                    layer.open({
                        content: '操作失败,请稍后再试!!!'
                        ,skin: 'msg'
                        ,time: 2 //2秒后自动关闭
                    });
                }else{
                    location.href="{:U('Home/Index/index')}";
                }
            }
        });
    });
</script>
</body>
</html>